<?php
use yii\helpers\Html;
use yii\helpers\Url;
use app\lib\WeixinUtils;

/* @var $this yii\web\View */
/* @var $content string 字符串 */


$imgUrl = Url::to("@web/img/wx");
$jsUrl = Url::to("@web/js/wx");
$basejsUrl = Url::to("@web/js");
$cssUrl = Url::to("@web/css/wx");
$web = Url::to("@web");
//获取微信js
$sign= WeixinUtils::getJs_SignPackage();
?>

<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">

    <link rel="stylesheet" href="<?= $cssUrl ?>/payment_success.css"/>
    <script src="<?= $basejsUrl ?>/jquery.js"></script>
	<script src="<?= $web ?>/js/wx/wx_utils.js"></script>
    <script src="http://res.wx.qq.com/open/js/jweixin-1.1.0.js"></script>
    <script type="application/javascript">
        $(document).ready(function () {
            var w = $(document).width();

            var bodyFontSize = parseInt($("body").css("font-size"));
            $("body").css("font-size", w * bodyFontSize / 320);

            var suucessText2MarginTop = parseInt($(".success-text-2").css("margin-top"));
            $(".success-text-2").css("margin-top", w * suucessText2MarginTop / 320);
        });


       wx.config({
            debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来，若要查看传入的参数，可以在pc端打开，参数信息会通过log打出，仅在pc端时才会打印。
            appId: '<?=APPID?>', // 必填，公众号的唯一标识
            timestamp:<?=$sign['timestamp']?> , // 必填，生成签名的时间戳
            nonceStr: '<?=$sign['nonceStr']?>', // 必填，生成签名的随机串
            signature: '<?=$sign['signature']?>',// 必填，签名，见附录1
            jsApiList: jsApiList_order_share // 必填，需要使用的JS接口列表，所有JS接口列表见附录2
        });
        wx.ready(function(){
            var orderid=$("#hidden_orderid").val();
            var url=$("#hidden_url").val()+"?id="+orderid;
			
            wx_setShare({
				title: '<?=$user['NICK_NAME']?>送你朵拉礼卡', // 分享标题
                desc: '点击兑换朵拉盒好礼！朵拉超越你的想象，精彩好礼随心兑换！送心意、送逼格！送礼就选朵拉盒 ', // 分享描述+orderid
                link: url
			});
        });
    </script>
    <title>支付成功</title>
</head>
<body>
<input type="hidden" id="hidden_orderid" value="<?=$orderid?>"/>
<input type="hidden" id="hidden_url" value="<?=Url::to(["wx-biz/gift-receive"],true)?>"/>

<table border="0" cellpadding="0" cellspacing="0" style="width: 100%; margin: 0;">
    <tr>
        <td class="share-guide-0"></td>
        <td valign="bottom">
            <div style="margin-bottom: 0.2em;">
                <div class="success-img"></div>
                <div class="success-text-1">支付成功</div>
                <div class="success-text-2">
                    <label>您可以到</label>
                    <label class="success-text-2-2">送礼记录</label>
                    <label>中找到朵拉卡并发送给您朋友</label>
                </div>
            </div>
        </td>
        <td class="share-guide-1">
        </td>
    </tr>
</table>
<div class="share-guide-2"/>
</body>
</html>

